#pragma
#include<iostream>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
#include<fcntl.h>

using namespace std;
#define Path "./fifo"
#define MODE 0666
class Fifo
{
private:
    const string& _path;
public:
    Fifo(const string& path):_path(path){
       int ret =  mkfifo(_path.c_str(),MODE);
       if(ret == 0){
        cout<<"mkfifo success"<<endl;
       }else{
        cout<<"mkfifo error"<<endl;
        exit(1);
       }
    }
    ~Fifo(){
        int ret = unlink(_path.c_str());
        if(ret == 0){
            cout<<"unlink success"<<endl;
        }else{
            cout<<"unlink error"<<endl;
        }
    }
};